package com.tedu.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.tedu.dao.IAddressDao;
import com.tedu.model.Address;
import com.tedu.service.IAddressService;
@Service
public class AddressService	implements IAddressService {
	private IAddressDao addressDao;
	@Resource
	public void setAddressDao(IAddressDao addressDao) {
		this.addressDao = addressDao;
	}
	
	public void add(Address address) {
		addressDao.add(address);
	}
	
	public void delete(int id) {
		addressDao.delete(id);
	}

	public void update(Address address) {
		addressDao.update(address);
	}

	public Address load(int id) {
		return addressDao.load(id);
	}

	public List<Address> list(int uid) {
		return addressDao.list(uid);
	}
	/////////////

	@Override
	public void updateAllStatus() {
		addressDao.updateAllStatus();
	}

	@Override
	public void setDefaule(int aid) {
		updateAllStatus();
		addressDao.updateOneStatus(aid);	
	}

	@Override
	public List<Address> commomList(int uid) {
		return addressDao.commomList(uid);
	}

	@Override
	public List<Address> defaultList(int uid) {
		return addressDao.defaultList(uid);
	}


}
